extends KinematicBody2D

var speed = 200

var target_position = Vector2(405,443)

func _ready():
	pass

func _physics_process(delta):
	if target_position!= global_position:
		var direction = (target_position - global_position).normalized()
		move_and_slide(direction * speed)
	pass
func _input(event):
	if event is InputEventMouseButton and event.button_index == BUTTON_LEFT and event.pressed:
		target_position = get_global_mouse_position()
#		print("鼠标点击位置坐标：", target_position)
	pass
